<?php
class Admin_Form_Iframe extends Admin_Form_Abstract
{
    const URL_PATTERN    = '/^(http:\/\/|https:\/\/|www\.)([\w\d\-]+\.){1,}[\w]{2,}(\/[\S]*)*$/';
   // static const TYPE = '3';
     public function __construct(array $options = null)
    {   
        parent::__construct();
    }

   public function init(){
        
        $this->setAttrib("class", "form_iframe");
        
        $this->addElement("hidden", 'hdf_type', array(
            'value'=>'3',
            'decorators' => array('ViewHelper')
        ));
         $this->addElement("hidden", 'hdf_check_show', array(
           'value'=>'1',
            'decorators' => array('ViewHelper')
        ));
        
        $this->addElement("text", 'iframe_url', array(
            'label' => "LBL_IFRAME" ,
            'required' => true,
            'description' => "Enter the URL for the iframe"
        ));
        $this->iframe_url->setAttrib('maxlength','255');
        
        $this->addElement("text", 'iframe_height', array(
            'label' => "LBL_IFRAME_HEIGHT" ,
            'required' => true,
            'value' => '800',
            "validators" => array(
                array("validator" => "Int")
            )
        ));
        $this->iframe_height->setAttrib('maxlength','4');
        
        $this->addElement("checkbox", 'iframe_hide_scroll', array(
            'label' => "LBL_IFRAME_SCROLL" ,
            'value'=>'1'
        ));
        $this->iframe_url->addValidator('regex', true, 
            array(
                'pattern' =>self::URL_PATTERN, 
                'messages'=>array(
                    'regexNotMatch'=>'URL invalid'
                )
            )
        );
        
        $this->addElement('submit', 'submit', array(
            'class' => 'button_control greenbutton',
            'value' => 'BUTTON_SAVE',
            'label'=> 'BUTTON_SAVE',
            'decorators' => $this->_button_decorators
        ));
         
    }
}